<extend name="Common:base" />

<block name="stylesheet">
<link rel="stylesheet" href="__CSS__/list.css" />
</block>

<block name="title">
<title>结点列表</title>
</block>

<block name="main-content">


    <div class="col-sm-9 col-md-10 main">
    <p>
    <a href="{:U('Rbac/newNode', array('pid' => 0, 'level' => 1))}" class="btn btn-default">新添应用结点</a>
    </p>

<ul class="list-unstyled" id="list">
  {/* 这一级foreach处理应用结点 */}
  <foreach name="node_list" item="u">
    <li><a href="{:U('Rbac/editNode' , array('id' => $u['id']))}" class="app_node">{$u.name}({$u.title})</a> <a class="btn btn-default btn-sm" href="{:U('Rbac/newNode' , array('pid' => $u['id'], 'level' => $u['level'] + 1))}">新加控制器结点</a>
    {/* 这一级foreach处理控制器结点 */}
    <if condition="isset($u['child'])">
      <ul class="list-inline">
        <foreach name="u.child" item="a">
          <li><a href="{:U('Rbac/editNode' , array('id' => $a['id']))}" class="controller_node">{$a.name}({$a.title})</a> <a class="btn btn-default btn-xs" href="{:U('Rbac/newNode' , array('pid' => $a['id'], 'level' => $a['level'] + 1))}">新加方法结点</a>
          {/* 这一级foreach处理方法结点 */}
          <if condition="isset($a['child'])">
            <ul class="list-inline">
              <foreach name="a.child" item="m">
              <li><a href="{:U('Rbac/editNode' , array('id' => $m['id']))}" class="method_node">{$m.name}({$m.title})</a></li>
              </foreach>
            </ul>
            </if>
            </li>
        </foreach>
      </ul>
      </if>
      </li>
  </foreach>
</ul>

    </div>


</block>
